<template>
    <div class="score">
        <div class="top">
            <div class="header">
                <div class="header1">
                    <div class="header-left">
                    <span @click="$router.go(-1)" v-if="$route.meta.noBack">
                        <i class="iconfont iconzuojiantou"></i>
                    </span>
                    </div>
                    <h3>
                        {{$route.meta.title}}
                    </h3>
                    <div class="header-right">
                        <router-link tag="span" to="/bindAccount">绑定账户</router-link>
                    </div>
                </div>
            </div>

            <div class="total-score">
                <p>总资产(积分)</p>
                <h1>{{userinfo.money}}</h1>
            </div>
            <ul class="middle-card flex-between">
                <router-link tag="li" to="/scoreIn" class="flex-center">
                    <img src="../../assets/img/score-tab1.png" alt="">
                    <p>积分充值</p>
                </router-link>
                <router-link tag="li" to="/scoreOut" class="flex-center">
                    <img src="../../assets/img/score-tab2.png" alt="">
                    <p>积分提现</p>
                </router-link>
                <router-link tag="li" to="/scoreRecord" class="flex-center">
                    <img src="../../assets/img/score-tab3.png" alt="">
                    <p>积分记录</p>
                </router-link>
            </ul>
            <ul class="record-list">
                <li v-for="(item,index) in list" :key="index">
                    <record-list
                        :logo="userinfo.avatar"
                        :name="userinfo.nickname"
                        :date="item.createtime"
                        :score="item.money"
                        :type="item.type"
                        pay_type="0"
                    ></record-list>
                </li>
            </ul>
        </div>
    </div>
</template>

<script>
    import RecordList from "@/components/recordList"
    import LoadMore from '@/components/upload'
    export default {
        name: "score",
        components:{
            RecordList,LoadMore
        },
        data(){
            return{
                logo: require('../../assets/img/banner.png'),
                score:0,
                list:[],
                userinfo:{},
                now_page:1
            }
        },
        mounted(){
            this.getData();
        },
        methods:{
            getData(page=1){
                this.$http.post('user/myIntegral',{}).then(res=>{
                    console.log(res)
                    this.userinfo = res.data.userinfo;
                    this.list = res.data.integralList.data;
                    this.has_more = res.data.integralList.has_more
                })
            },
        }
    }
</script>

<style scoped lang="less">
    @font-color:white;
    .score{
        position: relative;
        .top{
            padding:90px 30px 0 ;
            height: 422px;
            background: url("../../assets/img/score-bg.png") no-repeat 100% 100%;
            background-size: 100% 100%;
            box-sizing: border-box;
            .header{
                height: 90px;
                overflow: hidden;
                position: fixed;
                top: 0;
                left: 0;
                width: 100%;
            }
            .header1{
                height: 92px;
                background:linear-gradient(90deg, #1c62ff , #2a93ff );
                display: flex;
                justify-content: space-between;
                align-items: center;
                z-index: 10;
                &>div{
                    width: 200px;
                }
                .header-left{
                    span{
                        display: inline-block;
                        height: 100%;
                        padding: 0 24px;
                        i{
                            font-size: 40px;
                            color: @font-color;
                        }
                    }
                }
                h3{
                    font-size: 36px;
                    color: @font-color;
                    font-weight: normal;
                }
                .header-right{
                    text-align: right;
                    span{
                        display: inline-block;
                        height: 100%;
                        padding: 0 24px;
                        font-size: 30px;
                        color:@font-color;
                    }
                }
            }
            .total-score{
                color:white;
                padding-top: 40px;
                p{
                    font-size: 28px;
                }
                h1{
                    font-size: 72px;
                    font-weight: normal;
                    font-weight: normal;
                }
            }
            .middle-card{
                margin-top: 70px;
                width: 690px;
                height: 184px;
                background-color: #ffffff;
                border-radius: 20px;
                padding: 0 80px;
                box-sizing: border-box;
                .flex-center{
                    flex-direction: column;
                    padding: 30px 0;
                    img{
                        margin-bottom: 8px;
                    }
                }
            }
        }
        .record-list{
            width: 690px;
            margin: 20px auto;
            background: white;
            padding: 0 30px;
            box-sizing: border-box;
        }
    }

</style>
